package io.persimmon.core.dto.factory;

import io.persimmon.core.dto.*;

public class RequestFactory {
    public static <T> EmptyRequest create() {
        return new EmptyRequest();
    }

    public static <T> BaseRequest<T> create(T param) {
        BaseRequest<T> request = new BaseRequest<>();
        request.setParam(param);
        return request;
    }

    public static <T> BaseRequest<T> create(T param, String appKey, String appVersion) {
        HeaderRequest<T> request = new HeaderRequest<>();
        request.setParam(param);
        request.setAppKey(appKey);
        request.setAppVersion(appVersion);
        return request;
    }

    public static <T> BaseRequest<T> create(T param, Long userId) {
        UserRequest<T> request = new UserRequest<>();
        request.setParam(param);
        request.setUserId(userId);
        return request;
    }

    public static <T> BaseRequest<T> create(T param, String appKey, String appVersion, Long userId) {
        Request<T> request = new Request<>();
        request.setParam(param);
        request.setAppKey(appKey);
        request.setAppVersion(appVersion);
        request.setUserId(userId);
        return request;
    }
}
